import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {LifeComponent} from './life.component';
import {DiaryComponent} from './diary/diary.component';
import {DiaryDetailComponent} from './diary-detail/diary-detail.component';

const routes: Routes = [
  {
    path: '',
    component: LifeComponent,
    children: [
      {
        path: '',
        redirectTo: 'diary',
        pathMatch: 'full'
      },
      {
        path: 'diary',
        component: DiaryComponent,
      },
      {
        path: 'detail/:id',
        component: DiaryDetailComponent
      }
    ],
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class LifeRoutingModule {
}
